package com.xh.xyzp.common.domain.vo.req;

import com.xh.xyzp.exception.ApiException;
import com.xh.xyzp.util.AssertUtil;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Objects;

/**
 * @Author: xianghao
 * @Description:
 * @Date: 2024-03-24  14:23
 */
@Data
public class PageReq {

    @ApiModelProperty("每页大小")
    private Long pageSize;

    @ApiModelProperty("当前页数")
    private Long currPage;

    public void checkParams() {
        if (Objects.isNull(pageSize)) {
            throw new ApiException("每页大小不能为空");
        }
        if (Objects.isNull(currPage)) {
            throw new ApiException("当前页数不能为空");
        }
    }

}
